package com.gaga.crm;

import org.apache.shiro.crypto.hash.Md5Hash;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest
@RunWith(SpringRunner.class)
public class Md5Tester {

    @Test
    public void testMd5Hash() {
        String password = "123456";
        String salt = "gaga";
        Md5Hash md5Hash = new Md5Hash(password, salt);
        System.out.println(md5Hash.toString());
        //输出：085e0e9ace0c4119ce3cd0d3e811cba5
    }

    @Test
    public void testMd5HashTwo() {
        String password = "123456";
        String salt = "gaga";
        Md5Hash md5Hash = new Md5Hash(password, salt,2);
        System.out.println(md5Hash.toString());
        //输出：82cf3847d55d9f93fd45bb41fd390db6
    }

    @Test
    public void testMd5HashTwo123() {
        String password = "123123";
        String salt = "gaga";
        Md5Hash md5Hash = new Md5Hash(password, salt,2);
        System.out.println(md5Hash.toString());
        //输出：e0f0a00b2e67cfb121d6f9b8571d4a15
    }
}
